package com.ywjt.platformbusiness.home.adapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.base.MenuModel;
import com.ywjt.platformbusiness.classify.model.FistLevelTypeModel;
import com.ywjt.platformbusiness.home.CommonModel;
import com.ywjt.platformbusiness.util.PictureUtils;

import java.util.List;

public class HomeMenuAdapter extends BaseQuickAdapter<MenuModel, BaseViewHolder> {

    public HomeMenuAdapter(@Nullable List<MenuModel> data) {
        super(R.layout.item_home_menu, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MenuModel item) {
        ImageView ivMenu=helper.getView(R.id.ivMenu);
        Glide.with(mContext).load(item.getImg()).placeholder(R.mipmap.default_headlink)
                .apply(new RequestOptions().transform(new PictureUtils()))
                .into(ivMenu);
        helper.setText(R.id.tvTitle,item.getTitle());
    }
}
